package org.elsfs.cloud.module.ai.biz.controller;

import io.swagger.v3.oas.annotations.security.SecurityRequirement;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.elsfs.cloud.common.controller.LogicRepositoryCrudController;
import org.elsfs.cloud.module.ai.api.entity.AiKnowledge;
import org.elsfs.cloud.module.ai.biz.repository.AiKnowledgeRepository;
import org.springframework.http.HttpHeaders;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * AI知识库
 *
 * @author zeng
 * @version V1.0.0-M2
 * @since 2025-06-20
 */
@SecurityRequirement(name = HttpHeaders.AUTHORIZATION)
@RestController
@RequestMapping("/aiKnowledge")
@RequiredArgsConstructor
@Tag(description = "aiKnowledge", name = "模型配置管理")
public class AiKnowledgeController
        extends LogicRepositoryCrudController<
        AiKnowledge, AiKnowledge, AiKnowledge, AiKnowledge, AiKnowledgeRepository, String> {
//    @Override
//    public R<IPage<?>> page(AiKnowledge entity, DateQuery<AiKnowledge> qry) {
//        if (!getConfig().page()) {
//            return R.error("不支持分页查询");
//        }
//
//        final var wrapper = new JoinQueryWrapper<AiKnowledge>(entity);
//        wrapper.select(AiKnowledge.class,i->true)
//                .select("t0.model_name")
//                .leftJoin(AiModelConfig.class,"t0")
//                .on().eq("t.modelId","t0.modelId")
//                .end()
//                .like("t.name","文档")
//                .eq("t.delete_flag","0")
//        ;
//        return R.success(repository.joinPage(qry.toPage(),wrapper));
//    }
}
